import 'package:flutter/material.dart';

@immutable
class ChildWidget extends StatelessWidget {
  ChildWidget({this.active: true});

  final bool active;
  @override
  Widget build(BuildContext context) {
    return Container(
      alignment: Alignment.center,
      height: 200,
      width: 200,
      decoration: BoxDecoration(
        borderRadius: BorderRadius.all(Radius.circular(20)),
        color: active ? Colors.green : Colors.grey,
      ),
      child: Text(
        '父组件管理子组件状态',
        style: TextStyle(
            fontSize: 20, color: Colors.white, fontWeight: FontWeight.w900),
      ),
    );
  }
}
